var flag=[0,0];
$(".lsqcontent").click(function(event){
	var e=event||window.event;
	e.stopPropagation();
	var i=$(this).parent().index();
	// $(".lsqselect-list").eq(i).slideToggle(600);
	if(flag[i]==0){
		$(".lsqselect-list").eq(i).stop().slideDown(600);
		$(".con_pic").eq(i).css("transform","rotate(180deg)");
		flag[i]=1;
	}else if(flag[i]==1){
		$(".lsqselect-list").eq(i).stop().slideUp(600);
		$(".con_pic").eq(i).css("transform","rotate(0deg)");
		flag[i]=0;
	}
})
//冒泡
$(document).click(function(){
	$.each(flag,function(i){
		flag[i]=0;
		$(".lsqselect-list").stop().slideUp(600);
		$(".con_pic").eq(i).css("transform","rotate(0deg)");
	})	
})
// 选择
$(".lsqselect-list").click(function(event){
	var i=$(this).parent().index();
	var e=event||window.event;
	e.stopPropagation();
	$(".lsqselect-list").eq(i).stop().slideUp(600);
	$(".con_pic").eq(i).css("transform","rotate(0deg)");
	flag[i]=0;
	var content=e.target.innerHTML||e.srcElement.innerHTML;
	$(".con").eq(i).html(content)
})
// 分页(使用插件了，分页)
// function getMsg(){
//     $.ajax({
//         url:'data.json',
//         type:'GET',
//         dataType:'json',
//         success:function(data){
//             //1.计算分页数量
//             var showNum=4;//每页显示多少个数据
//             var dataL=data.length;//数据的长度
//             // console.log(dataL)
//             var pageNum=Math.ceil(dataL/showNum);//数据分为几页，向上取整
//             $('#Pagination').pagination(pageNum,{//初始化
//                 num_edge_entries: 2, //边缘页数
//                 num_display_entries: 4, //主体页数
//                 items_per_page:1, //每页显示1项
//                 prev_text: "<",
//                 next_text: ">",
//                 callback:function(index){
//                     //index是所在页数的下标 
//                     $('<span>前往<input type="text" class="page" value="'+Number(index+1)+'" readOnly>页</span>').appendTo($(".pagination"))
//                     $(".main-list").html("")                   
//                     for(var i = showNum*index; i < showNum*index+showNum;i++){
//                         if(i<dataL){
//                             $('<li class="main_li"><div class="main_title clearfix"><span class="ping">本地化资源搜索平台二次开发优化</span><span  class="main_xuan '+data[i].color+'">'+data[i].xuan+'</span><a href="detailsStop.html" class="main_link">查看详情</a></div><ul class="small"><li><div class="small_pic"><img src="images/project1.png" alt=""></div> <span class="main_type">项目类型</span><span class="small_con small_type">'+data[i].type+'</span></li><li><div class="small_pic"><img src="images/project2.png" alt=""></div><span class="main_type">所属行业</span><span class="small_con small_job">'+data[i].job+'</span></li><li><div class="small_pic"><img src="images/project3.png" alt=""></div><span class="main_type">紧急程度</span><span class="small_con small_ji">'+data[i].ji+'</span></li><li><div class="small_pic"><img src="images/project4.png" alt=""></div><span class="main_type">期望周期</span><span class="small_con small_qi">'+data[i].qi+'</span></li><li><div class="small_pic"><img src="images/project5.png" alt=""></div><span class="main_type">创建时间</span><span class="small_con small_time">'+data[i].time+'</span></li></ul></li>').appendTo($(".main-list"))    
//                         }
//                     }
//                 }
//             })
                    
//         }
//     })
// }
//  getMsg()
